<script setup lang="ts">
import { ref } from 'vue';

const props: any = defineProps<{
    ujt?: any;
    asaidata: any;
    formdata: any;
    formkey: any;
}>();
const rfico: any = ref(true);
</script>

<template>
    <div
        :class="`${asaidata.ic ? 'as-form-obj' : ''}`"
        v-if="typeof props.formdata[formkey] === 'object'"
    >
        <span
            :class="`${
                asaidata.ic > 1
                    ? rfico
                        ? 'as-form-ico-close'
                        : 'as-form-ico-open'
                    : ''
            }`"
            @pointerdown="rfico = !rfico"
        >
            {{ asaidata.eq > 2 ? '"' : ''
            }}{{
                (props.asaidata?.lang && props.asaidata?.lang[formkey]) ||
                formkey
            }}{{ asaidata.eq > 2 ? '"' : '' }}{{ asaidata.eq ? ':' : '' }}
        </span>
        {{
            asaidata.eq > 1
                ? Array.isArray(props.formdata[formkey])
                    ? '['
                    : '{'
                : ''
        }}
        <template v-if="rfico">
            <AsaiFormLi
                :ujt="ujt"
                :asaidata="asaidata"
                :formdata="props.formdata[formkey]"
            ></AsaiFormLi>
        </template>
        <template v-else>...</template>
        {{
            asaidata.eq > 1
                ? Array.isArray(props.formdata[formkey])
                    ? ']'
                    : '}'
                : ''
        }}{{ asaidata.eq > 2 ? ',' : '' }}
    </div>
</template>

<style scoped lang="scss"></style>
